/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Controller;

import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;
import Model.*;
import java.sql.SQLException;

/**
 *
 * @author Master
 */
public class controller_TaiKhoanKH {

    public void Them_TaiKhoan(model_TaiKhoanKH taiKhoanKH) {
        DataProvider data = new DataProvider();
        data.Open();

        String password = data.MD5(taiKhoanKH.getMatkhau()+ taiKhoanKH.getNgaytao());
        String query = String.format("INSERT INTO `tai_khoan_kh` VALUES ('%s','%s','%s','%s')", taiKhoanKH.getTentk(), password, taiKhoanKH.getCmnd(), taiKhoanKH.getNgaytao());

        data.ExecuteUpdate(query);
    }
}
